{include file='common/header' /}
<script>
    var M = {};
    $(function() {
        M.preins = function(){
            $.ajax({
                url: '{url('preins')}',
                type: 'POST',
                dataType: 'json',
                data: $('#install').serialize(),
                success:function(res){
                    if (res.code) {
                        EBCMS.MSG.confirm(res.msg,function(){
                            $('#install').submit();
                        });
                    }else{
                        EBCMS.MSG.alert(res.msg);
                    }
                },
                error:function(){
                    EBCMS.MSG.alert('服务器错误，请稍后再试！');
                }
            });
            return false;
        }
    });
</script>
<div class="container-fluid">
    <div class="row">
        <div class="col-md-12">
            <h3>
                <span>安装应用：<b class="text-danger">{$app.title} v{$version.version}</b></span>
            </h3>
            <table class="table table-bordered">
                <tr>
                    <td style="width: 100px;">应用名称</td>
                    <td>{$app.title} - {$app.name}</td>
                    <td>发布时间：{$app.create_time|date='Y-m-d',###}</td>
                </tr>
                <tr>
                    <td>应用简介</td>
                    <td colspan="2">{$app.description}</td>
                </tr>
                {notempty name='app.info'}
                {foreach name='app.info' item='vo'}
                <tr>
                    <td>{$key}</td>
                    <td colspan="2">{$vo}</td>
                </tr>
                {/foreach}
                {/notempty}
                
                {notempty name='app.author'}
                {foreach name='app.author' item='vo'}
                <tr>
                    <td>{$key}</td>
                    <td colspan="2">{$vo}</td>
                </tr>
                {/foreach}
                {/notempty}
                <tr>
                    <td>版本号</td>
                    <td colspan="2">
                        {$version.version}
                    </td>
                </tr>
                <tr>
                    <td>版本说明</td>
                    <td colspan="2">
                        {$version.content|htmlspecialchars_decode}
                    </td>
                </tr>
            </table>
            <div class="alert alert-danger alert-dismissible fade in" role="alert">
                <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
                <h4><strong>注意事项！</strong></h4>
                <p>应用安装属自愿原则，我们不承担由此带来的任何责任！</p>
                <p>为了安全起见，我们建议您全站备份！</p>
            </div>
            <form class="form-inline" id="install" role="form" method="GET" action="{:url('install')}">
                <div class="form-group">
                    <div class="input-group">
                        <div class="input-group-addon">安装码</div>
                        <input class="form-control" name="authcode" style="width: 700px;" type="text" placeholder="">
                    </div>
                </div>
                <button type="button" class="btn btn-danger" onclick="M.preins();">下一步</button>
                <button type="button" class="btn btn-default ebcms-go" url="{:url('store/index')}">返回</button>
                <p class="help-block">安装码实时更新，请到官网 <a href="http://www.ebcms.com/store/user/index.html" class="text-danger">[用户中心]</a> 获取！</p>
                <input type="hidden" name="app_id" value="{$app.id}">
            </form>
        </div>
    </div>
</div>
{include file='common/footer' /}